using System;

namespace STHPMS1.ICore.I_Common
{
	public class DisposeObject : IDisposable
	{
		#region IDisposable
		protected bool IsDisposed {
			get;
			set;
		}

		public void Dispose ()
		{
			Dispose (true);
			GC.SuppressFinalize (this);
		}

		private void Dispose (bool isDisposing)
		{
			try {
				if (!this.IsDisposed) {
					if (isDisposing) {
						OnDispose ();
					}
				}
			}
			finally {
				this.IsDisposed = true;
			}
		}

		protected virtual void OnDispose ()
		{
		}
	#endregion
	}
}
